package com.ykht.proj.coupon.Enum;

/**
 * 是否展示0是1否
 */
public enum MerchantTypeEnum {
	company(1,"公司"),
	brand(2,"品牌"),
	shop(3,"门店");

	private Integer value;
	private String desc;

	MerchantTypeEnum(Integer value, String desc) {
		this.value = value;
		this.desc = desc;
	}


	/**
	 * 根据val值获取desc
	 * @param val 1、0
	 * @return
	 */
	public static String getDescByVal(Integer val) {
		MerchantTypeEnum[] values = MerchantTypeEnum.values();
		for (MerchantTypeEnum oe : values) {
			if (oe.getValue().equals(val)) {
				return oe.getDesc();
			}
		}
		return null;
	}
	public static MerchantTypeEnum getThisByVal(Integer val) {
		MerchantTypeEnum[] values = MerchantTypeEnum.values();
		for (MerchantTypeEnum oe : values) {
			if (oe.getValue().equals(val)) {
				return oe;
			}
		}
		return null;
	}

	public Integer getValue() {
		return value;
	}

	public void setValue(Integer value) {
		this.value = value;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	}
